import ajax from './index'
import { append,appends } from './index'
//获取淘客cps订单统计
export const getTaokeCPSInfo = () => {
  return ajax.get(`/partner_admin/orders/tbk_cps/count`)
}
//获取淘客cps订单
// export const getTaokeCPSOrders = data => {
//   return ajax.get(`/partner_admin/orders/tbk_cps/search${append(data)}`)
// }
export function getTaokeCPSOrders(query) {
  return ajax({
    url: '/backend/partner/data/distributionOrders',
    method: 'get',
    params: appends(query)
  });
}

// 平台订单
export function platformOrders(query) {
  return ajax({
    url: '/backend/partner/data/platformOrders',
    method: 'get',
    params: appends(query)
  });
}

//红包兑换订单/backend/partner/data/redPacketsOrders
export function getExchangeOrders(query) {
  return ajax({
    url: '/backend/partner/data/platformOrders',
    method: 'get',
    params: appends(query)
  });
}

// export const getExchangeOrders = data => {
//   return ajax.get(
//     `partner_admin/orders/manage_shop/order/search${append(data)}`
//   )
// }
//红包兑换订单统计
export const getExchangeInfo = () => {
  return ajax.get('partner_admin/orders/manage_shop/self_order/census/get')
}
//获取服务商订单
export const getServerInfo = () => {
  return ajax.get('partner_admin/orders/incomes/count')
}

//获取服务商订单
export const getServerOrders = data => {
  return ajax.get(`partner_admin/orders/incomes/search${append(data)}`)
}

// 获取服务订单列表
// export const getShopServiceOrders = data => {
//   return ajax.get(`/partner_admin/orders/service_order/list${append(data)}`)
// }
export function getShopServiceOrders(query) {
  return ajax({
    url: '/backend/partner/data/storeServiceOrders',
    method: 'get',
    params: appends(query)
  });
}

// 订单收益统计
export const getIncomesStatistic = data => {
  return ajax.get(`/partner_admin/orders/incomes/statistic${append(data)}`)
}

// 小店入驻订单列表
// export const getSettleInOrder= data => {
//   return ajax.get(
//     `partner_admin/orders/search${append(data)}&order_type=40`
//   )
// }

export function getSettleInOrder(query) {
  return ajax({
    url: '/backend/partner/data/shopOrderPageList/shopOrderPageList',
    method: 'get',
    params: appends(query)
  });
}
